package com.ruoyi.technology.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.technology.mapper.TechnologyDistributeMapper;
import com.ruoyi.technology.domain.TechnologyDistribute;
import com.ruoyi.technology.service.ITechnologyDistributeService;
import com.ruoyi.common.core.text.Convert;

/**
 * 工艺分配Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-01-13
 */
@Service
public class TechnologyDistributeServiceImpl implements ITechnologyDistributeService 
{
    @Autowired
    private TechnologyDistributeMapper technologyDistributeMapper;

    /**
     * 查询工艺分配
     * 
     * @param id 工艺分配主键
     * @return 工艺分配
     */
    @Override
    public TechnologyDistribute selectTechnologyDistributeById(Long id)
    {
        return technologyDistributeMapper.selectTechnologyDistributeById(id);
    }

    /**
     * 查询工艺分配列表
     * 
     * @param technologyDistribute 工艺分配
     * @return 工艺分配
     */
    @Override
    public List<TechnologyDistribute> selectTechnologyDistributeList(TechnologyDistribute technologyDistribute)
    {
        return technologyDistributeMapper.selectTechnologyDistributeList(technologyDistribute);
    }

    /**
     * 新增工艺分配
     * 
     * @param technologyDistribute 工艺分配
     * @return 结果
     */
    @Override
    public int insertTechnologyDistribute(TechnologyDistribute technologyDistribute)
    {
        return technologyDistributeMapper.insertTechnologyDistribute(technologyDistribute);
    }

    /**
     * 修改工艺分配
     * 
     * @param technologyDistribute 工艺分配
     * @return 结果
     */
    @Override
    public int updateTechnologyDistribute(TechnologyDistribute technologyDistribute)
    {
        technologyDistribute.setUpdateTime(DateUtils.getNowDate());
        return technologyDistributeMapper.updateTechnologyDistribute(technologyDistribute);
    }

    /**
     * 批量删除工艺分配
     * 
     * @param ids 需要删除的工艺分配主键
     * @return 结果
     */
    @Override
    public int deleteTechnologyDistributeByIds(String ids)
    {
        return technologyDistributeMapper.deleteTechnologyDistributeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除工艺分配信息
     * 
     * @param id 工艺分配主键
     * @return 结果
     */
    @Override
    public int deleteTechnologyDistributeById(Long id)
    {
        return technologyDistributeMapper.deleteTechnologyDistributeById(id);
    }
}
